home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
1116.ZIP
/
TOOLKIT.ARC
/
GETNUM.C
< prev
next >
Wrap
Text File
|
1979-12-31
|
1KB
|
36 lines
/* GETNUM.C
Note: A>link
[.OBJ]: getnum.obj + getint.obj + stdio.obj
[.EXE]: getnum.exe
[.MAP]: <cr>
[.LIB]: cpclib.lib
*/
main()
{
int n;
int10(6,0,7,0,0,0,24,79); /* clearscreen via BIOS */
int10(2,0,0,0,0,0,0,0); /* home the cursor */
putchar(13);
puts("Enter a decimal number: "); n = getint("%d",n);
puts("The number is: "); printf("%d",n);
putchar(13);
puts("Enter a hexadecimal number: "); n = getint("%h",n);
puts("The number is: "); printf("%d",n);
putchar(13);
puts("Enter an octal number: "); n = getint("%o",n);
puts("The number is: "); printf("%d",n);
putchar(13);
puts("Enter a binary number: "); n = getint("%b",n);
puts("The number is: "); printf("%d",n);
int10(2,0,0,0,0,0,10,70); /* cursor at row 10, column 70 */
putchar(65);
n = getval(10,70,n);
int10(2,0,0,0,0,0,22,0);
puts("The ASCII value at 10,70 is: "); printf("%d",n);
}